/**
 * @file argsParser.h
 * @author SDK_TEAM
 * @brief
 * @version 0.1
 * @date 2022-10-26
 *
 * Copyright:
 * © 2018 北京灵汐科技有限公司 版权所有。
 * 注意：以下内容均为北京灵汐科技有限公司原创，未经本公司允许，不得转载，否则将视为侵权；对于不遵守此声明或者其他违法使用以下内容者，本公司依法保留追究权。
 * © 2018 Lynxi Technologies Co., Ltd. All rights reserved.
 * NOTICE: All information contained here is, and remains the property of Lynxi.
 * This file can not be copied or distributed without the permission of Lynxi
 * Technologies Co., Ltd.
 *
 */
#pragma once

#include <stdlib.h>
#include <string>
#include "util.hpp"
#include "CLI/CLI11.hpp"

namespace ArgsParse
{
    std::string argJsonPath;

    bool yolov5ArgsParser(int argc, char *argv[])
    {
        CLI::App app;

        std::string argChips;
        int showType;

        app.add_option("input_video", argInputFilePath, "input MP4 video file path")
            ->default_val("../data/yolov8_detect_with_video_sample/MOT16-09.mp4");
        app.add_option("-m,--modelPath", argModelPath, "yolov8 model path")
            ->default_val("../model/model_yolov8s_640_11528_x6/Net_0");
        app.add_option("-p,--postPlugPath", argPostPluginPath, "yolov8 post process plugin path")
            ->default_val("../common/plugin/postprocess/cross_compiled_lib/libYolov8X6PostPlugin.so");
        app.add_option("-o,--osdPlugPath", argOsdPluginPath, "osd process plugin path")
            ->default_val("../common/plugin/osd/lib/libOsdPlugin.so");
        app.add_option("-d,--device_id", argChips, "test device number which can be 0~N-1 (N is device count), eg.:0,1,2")
            ->default_val(0);
        app.add_option("-c,--channelCount", argChannel, "process channel count")
            ->default_val(1);
        app.add_option("-s,--showType", showType, "0: show test file directly, 1: save test result to be a file, 2: only apu + postProcess.")
            ->default_val(1);

        CLI11_PARSE(app, argc, argv);

        if (!setChips(argChips.c_str(), ','))
        {
            return false;
        }

        setShowType(showType);
        return true;
    }
} // namespace ArgsParse
